<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{textformat}</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<link rel="home" href="index.html" title="Smarty マニュアル">
<link rel="up" href="language.custom.functions.html" title="Chapter 8. カスタム関数">
<link rel="prev" href="language.function.popup.init.html" title="{popup_init}">
<link rel="next" href="config.files.html" title="Chapter 9. 設定ファイル">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">{textformat}</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="language.function.popup.init.html">Prev</a> </td>
<th width="60%" align="center">Chapter 8. カスタム関数</th>
<td width="20%" align="right"> <a accesskey="n" href="config.files.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="{textformat}">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="language.function.textformat"></a>{textformat}</h2></div></div></div>
<p>
   <code class="varname">{textformat}</code> は、
   テキストを整形するために用いる
   <a class="link" href="plugins.block.functions.html" title="ブロック関数プラグイン">ブロック関数</a> です。
   これは基本的に空白と特殊文字を取り除き、
   境界でラップして行をインデントする事によって段落を整形します。
  </p>
<p>
   明示的にパラメータを設定したり、あらかじめ決められたスタイルを使用したりできます。現在、
   <span class="quote">“<span class="quote">email</span>”</span> のみが有効なスタイルです。
 </p>
<div class="informaltable"><table border="1">
<colgroup>
<col align="center">
<col align="center">
<col align="center">
<col align="center">
<col>
</colgroup>
<thead><tr>
<th align="center">属性名</th>
<th align="center">型</th>
<th align="center">必須</th>
<th align="center">デフォルト</th>
<th>概要</th>
</tr></thead>
<tbody>
<tr>
<td align="center">style</td>
<td align="center">string</td>
<td align="center">No</td>
<td align="center"><span class="emphasis"><em>n/a</em></span></td>
<td>あらかじめ決められたスタイル</td>
</tr>
<tr>
<td align="center">indent</td>
<td align="center">number</td>
<td align="center">No</td>
<td align="center"><span class="emphasis"><em>0</em></span></td>
<td>各行をインデントするキャラクタ数</td>
</tr>
<tr>
<td align="center">indent_first</td>
<td align="center">number</td>
<td align="center">No</td>
<td align="center"><span class="emphasis"><em>0</em></span></td>
<td>最初の行をインデントするキャラクタ数</td>
</tr>
<tr>
<td align="center">indent_char</td>
<td align="center">string</td>
<td align="center">No</td>
<td align="center"><span class="emphasis"><em>(半角スペース１個)</em></span></td>
<td>インデントするために使われるキャラクタ(又は文字列)</td>
</tr>
<tr>
<td align="center">wrap</td>
<td align="center">number</td>
<td align="center">No</td>
<td align="center"><span class="emphasis"><em>80</em></span></td>
<td>各行をいくつのキャラクタ数でラップするか</td>
</tr>
<tr>
<td align="center">wrap_char</td>
<td align="center">string</td>
<td align="center">No</td>
<td align="center"><span class="emphasis"><em>\n</em></span></td>
<td>各行を分割するためのキャラクタ(又は文字列)</td>
</tr>
<tr>
<td align="center">wrap_cut</td>
<td align="center">boolean</td>
<td align="center">No</td>
<td align="center"><span class="emphasis"><em><code class="constant">FALSE</code></em></span></td>
<td>
<code class="constant">TRUE</code> ならば、単語の境界の代わりに正確なキャラクタ数で行を分割します。</td>
</tr>
<tr>
<td align="center">assign</td>
<td align="center">string</td>
<td align="center">No</td>
<td align="center"><span class="emphasis"><em>n/a</em></span></td>
<td>出力が割り当てられるテンプレート変数</td>
</tr>
</tbody>
</table></div>
<div class="example">
<a name="id2807109"></a><p class="title"><b>Example 8.27. {textformat}</b></p>
<div class="example-contents">
<pre class="programlisting">

   {textformat wrap=40}

   This is foo.
   This is foo.
   This is foo.
   This is foo.
   This is foo.
   This is foo.

   This is bar.

   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.

   {/textformat}


  </pre>
<p>
   上の例の出力
  </p>
<pre class="screen">


   This is foo. This is foo. This is foo.
   This is foo. This is foo. This is foo.

   This is bar.

   bar foo bar foo foo. bar foo bar foo
   foo. bar foo bar foo foo. bar foo bar
   foo foo. bar foo bar foo foo. bar foo
   bar foo foo. bar foo bar foo foo.

  </pre>
<pre class="programlisting">

   {textformat wrap=40 indent=4}

   This is foo.
   This is foo.
   This is foo.
   This is foo.
   This is foo.
   This is foo.

   This is bar.

   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.

   {/textformat}


  </pre>
<p>
   上の例の出力
  </p>
<pre class="screen">


   This is foo. This is foo. This is
   foo. This is foo. This is foo. This
   is foo.

   This is bar.

   bar foo bar foo foo. bar foo bar foo
   foo. bar foo bar foo foo. bar foo
   bar foo foo. bar foo bar foo foo.
   bar foo bar foo foo. bar foo bar
   foo foo.

  </pre>
<pre class="programlisting">

   {textformat wrap=40 indent=4 indent_first=4}

   This is foo.
   This is foo.
   This is foo.
   This is foo.
   This is foo.
   This is foo.

   This is bar.

   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.

   {/textformat}

  </pre>
<p>
   上の例の出力
  </p>
<pre class="screen">


   This is foo. This is foo. This
   is foo. This is foo. This is foo.
   This is foo.

   This is bar.

   bar foo bar foo foo. bar foo bar
   foo foo. bar foo bar foo foo. bar
   foo bar foo foo. bar foo bar foo
   foo. bar foo bar foo foo. bar foo
   bar foo foo.

  </pre>
<pre class="programlisting">

   {textformat style="email"}

   This is foo.
   This is foo.
   This is foo.
   This is foo.
   This is foo.
   This is foo.

   This is bar.

   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.
   bar foo bar foo     foo.

   {/textformat}


  </pre>
<p>
   上の例の出力
  </p>
<pre class="screen">


   This is foo. This is foo. This is foo. This is foo. This is foo. This is
   foo.

   This is bar.

   bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
   bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
   foo.


  </pre>
</div>
</div>
<br class="example-break"><p>
  <a class="link" href="language.function.strip.html" title="{strip}"><code class="varname">{strip}</code></a>
  および
  <a class="link" href="language.modifier.wordwrap.html" title="wordwrap"><code class="varname">wordwrap</code></a>
  も参照してください。
 </p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="language.function.popup.init.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="language.custom.functions.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="config.files.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">{popup_init} </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> Chapter 9. 設定ファイル</td>
</tr>
</table>
</div>
</body>
</html>
